<%@ page import="com.cn.entity.BookUnion" %>
<%@ page import="com.cn.entity.NewsInfo" %>
<%@ page import="com.cn.Dao.NewsinfoDao" %>
<%@ page import="com.cn.entity.BookInfo" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%--
  Created by IntelliJ IDEA.
  User: cza20
  Date: 2021/4/12
  Time: 16:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>查看我的订单</title>
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/img/logo2.png" type="image/x-icon">
</head>
<body>
<jsp:include page="index.html"/>
<jsp:include page="WEB-INF/header/header-user.jsp"/>
<jsp:useBean id="userInfo" class="com.cn.entity.UserInfo" scope="session"/>

<%
    List<BookUnion> bookUnions= (List<BookUnion>) request.getSession().getAttribute("bookUnions");
%>

<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th>
                        #
                    </th>
                    <th>
                        用户
                    </th>
                    <th>
                        报刊
                    </th>
                    <th>
                        总价格
                    </th>
                    <th>
                        订单状态
                    </th>
                </tr>
                </thead>
                <tbody>
                <%for(int i=0;i<bookUnions.size();i++){%>
                <tr >
                    <td>
                        <%=bookUnions.get(i).getBid()%>
                    </td>
                    <td>
                        <%=bookUnions.get(i).getUsername()%>
                    </td>
                    <td>
                        <%=bookUnions.get(i).getNewsname()%>
                    </td>
                    <td>
                        <%=bookUnions.get(i).getPrice()%>
                    </td>
                    <td>
                        <%if (bookUnions.get(i).getState()==0)
                            out.print("拒绝");
                        else if (bookUnions.get(i).getState()==1)
                            out.print("接受");
                        else if (bookUnions.get(i).getState()==2)
                            out.print("未处理");
                        %>
                        <%--                            <%=bookInfos.get(i).getState()%>--%>
                    </td>
                </tr>
                <%}%>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/scripts.js"></script>
</script>
</body>
</html>




